import requests

url = 'https://httpbin.org/get'

req_headers1 = requests.get(url).request.headers
print(f"默认的请求头信息是：{req_headers1}")

headers = {'User-Agent': 'python-requests/2.32.3', 'Connection': 'keep-alive'}

req_headers2 = requests.get(url, headers=headers).request.headers
print(f"修改后的请求头信息是：{req_headers2}")

